Skip to main content

OwnableValidator Smart Contract Documentation

Overview

The OwnableValidator is a Solidity smart contract that implements a multi-signature validation mechanism for Ethereum accounts. It allows accounts to designate multiple owners and define a threshold of signatures required to validate transactions or messages.

Key Features

  1. Multi-signature Support: Multiple owners can be assigned to an account
  2. Configurable Threshold: Users can set how many signatures are required for validation
  3. Owner Management: Functionality to add and remove owners
  4. ERC-4337 Compatible: Supports validation for UserOperations
  5. ERC-1271 Support: Implements signature validation standard

Core Concepts

Initialization

  • Users can initialize the module by providing:
    • A threshold (number of required signatures)
    • A list of owner addresses
  • Maximum of 32 owners per account

Validation Mechanisms

The contract provides three types of validation:

  1. UserOperation validation (ERC-4337)
  2. ERC-1271 signature validation
  3. Stateless signature validation with provided configuration

Owner Management

  • Owners can be added and removed
  • The number of owners must always be greater than or equal to the threshold
  • Owner addresses are stored in a sorted, unique list

Security Features

  • Ensures owners are unique and sorted
  • Prevents removal of owners if it would make the threshold unreachable
  • Validates signature uniqueness during checks
  • Uses a sentinel list for efficient owner management

Key Limitations

  • Maximum of 32 owners per account
  • Threshold must be greater than zero
  • Cannot remove owners if it would make the threshold impossible to reach

Events

  • ModuleInitialized: Emitted when the module is installed
  • ModuleUninitialized: Emitted when the module is uninstalled
  • ThresholdSet: Emitted when the signature threshold is changed
  • OwnerAdded: Emitted when a new owner is added
  • OwnerRemoved: Emitted when an owner is removed